import { ref, onMounted, onUnmounted } from "vue";

export function useListenScroll() {
  const action = ref(false);

  onMounted(() => {
    window.addEventListener("scroll", () => {
      if (document.documentElement.scrollTop > 1920) {
        action.value = true;
      } else {
        action.value = false;
      }
    });
  });

  onUnmounted(() => {
    window.removeEventListener("scroll", () => {});
  });

  return { action };
}
